<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path;
%>

<!DOCTYPE HTML>
<html>
	
  <head>
    
    <title>选择供应商</title>
    


<style>
	<!--
	table {
	table-layout: fixed;
	word-wrap:break-word;
	}
	td{
		
		word-break:break-all;
	}
	
	}
	//-->
</style>

  </head>
  <base target="_self"></base>
  <body>
    <table  width="100%"  border="0" cellpadding="0" cellspacing="0" height="100%">
  	
  	<tr valign="top">
  		<td>
  			<table width="100%"  border="0" cellpadding="0" cellspacing="0">
  
 <tr>
    	
    	<td width="100%">
    		<FONT size="6">选择供应商</FONT> 
    		
    		
    	</td>
    </tr>
    
    <tr>
    	
     	
     	
     	<td valign="top" >
     <table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%">
    	 <tr>
     		<td>
     	<table width="100%" height="100%" border="0" cellpadding="0" bgcolor="#e5f3ff" cellspacing="0" style= "border:1px solid #ffffff; border-top-color:#6cb1f1;">
     		
     		<tr>
     			<td>供应商信息
				<input type="button" value="查看谁有权限" 
     				onclick="javascript:openUrlForDialog('selectoperatorlimitedAction_background.action?limitedCode=<s:property value="limitedcode"/>')"/>
     			</td>
     		</tr>
     	</table>
     	</td>
     		</tr>
 <tr>
     		<td>
			
    	
			<table  border="0" >
				<tr>
				  <td>
					  查找供应商信息:<input type="text" name="searchStrinfo" id="searchStrinfo" size="30" value="<s:property value="searchStr"/>"/>
					  
					  <input type="button" onclick="javascript:openUrlForDialog('insertsupplierinfo_warehouse.action?searchStr='+$('#searchStrinfo').attr('value'))" value="查找" />
				  </td>
			  </tr>
			</table>
	</td>
     		</tr>
     		 <tr>
     		<td>
     		
		<table align="left"  border="0"  cellspacing="0" cellpadding="0" style= "border:1px solid #ffffff; border-bottom-color:#21a4dc;
    border-left-color:#21a4dc;border-right-color:#21a4dc;border-top-color:#21a4dc">
    
   	<s:iterator id="supplierList" value="supplierList" status="sta"> 
   		<tr>
   			<td width="115"><s:property value="#supplierList.id_supplier"/></td>
   			<td>
   			<a href="javascript:insertSupplier('<s:property value="#supplierList.name_supplier"/>,<s:property value="#supplierList.manager_supplier"/>,<s:property value="#supplierList.mobile_supplier"/>,<s:property value="#supplierList.mobile_supplier"/>,<s:property value="#supplierList.phone_supplier"/>,<s:property value="#supplierList.address_supplier"/>');">
   				<s:property value="#supplierList.name_supplier"/>
   			</a>
   			</td>
   			<td><button onclick="insertSupplier('<s:property value="#supplierList.name_supplier"/>,<s:property value="#supplierList.manager_supplier"/>,<s:property value="#supplierList.mobile_supplier"/>,<s:property value="#supplierList.mobile_supplier"/>,<s:property value="#supplierList.phone_supplier"/>,<s:property value="#supplierList.address_supplier"/>');">选择</button></td>
   		</tr>
     		
    </s:iterator>
     		
     		
     	</table> 
     	</td>
     	</tr>
     	</table>
     	
     	 <table width="100%" border="0" cellpadding="0" bgcolor="" cellspacing="0" >
				<tr >
					<td >
						<%
						int pageSize = (Integer) request.getAttribute("pageSize");
						int beginPageNum =  (Integer) request.getAttribute("beginPageNum");
						int countRow =  (Integer) request.getAttribute("rowNum");
					    int countPage =(countRow-1)/pageSize+1;
					    String usermail = (String)request.getAttribute("usermail");//*/
					    String url = "insertsupplierinfo_warehouse.action";//*/
					    
					    String searchstr = (String)request.getParameter("searchStr");//*/
					    if(searchstr != null){
					    	searchstr = java.net.URLDecoder.decode(searchstr, "UTF-8");
					    	//searchstr = java.net.URLEncoder.encode(searchstr,"UTF-8");
					    	//searchstr = searchstr.replaceAll("%", "%25");
					    }else{
					    	searchstr = "";
					    }
					    
					    if((beginPageNum-pageSize+1) >= 1){%>
				    	<a href="javascript:openUrlForDialog('<%=url %>?searchStr=<%=searchstr %>&beginPageNum=<%=(beginPageNum-pageSize) %>')">
								上一页 </a>
				 	  <% }
					    
					    //beginPageNum =  (pageNum - 1) * pageSize;
						StringBuffer chagePageBuff = new StringBuffer();
						if(countPage >= 2){
							for(int i=0;i<countPage;i++){
								if(beginPageNum == i*pageSize){
									%>
									<%=i+1 %>
									<%
								}else{
									%>
									<a href="javascript:openUrlForDialog('<%=url %>?searchStr=<%=searchstr %>&beginPageNum=<%=i*pageSize %>')">
									[<%=i+1 %>] </a>
									<%
								}
							}
						}
						
						if((beginPageNum+pageSize-countRow) < 0){%>
				    	<a href="javascript:openUrlForDialog('<%=url %>?searchStr=<%=searchstr %>&beginPageNum=<%=(beginPageNum+pageSize) %>')">
								下一页 </a>
				   		<% }
						//*/
						%>
					
					</td>

				</tr>
				
	</table>
	</td>
</tr>
</table>
  		
  		</td>
  	</tr>
  </table>

  
  </body>

</html>
